﻿@using SistemaAdministracion.Models.BaseClass
@model List<Persona>
@if (Model == null || Model.Count == 0)
{
    <h2>No exiten Personas</h2>
}
else
{
    <table>
        <thead>
            <tr>
                <th>
                    Rut
                </th>
                <th>
                    Nombres
                </th>
                <th>
                    Apellidos
                </th>
                <th>
                    Sexo
                </th>
                <th>
                    Acciones
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var pers in Model)
            {
                <tr>
                    <td>
                        @pers.RUN-@pers.DV
                    </td>
                    <td>
                        @pers.Nombres
                    </td>
                    <td>
                        @pers.ApPaterno @pers.ApMaterno
                    </td>
                    <td>
                        @pers.Sexo
                    </td>
                    <td>
                        @Ajax.ActionLink("Editar", "Editar", "Persona", new { rut = pers.RUN }, new AjaxOptions { HttpMethod = "POST" }) |
                        @Ajax.ActionLink("Eliminar", "Comprobar", "Persona", new { rut = pers.RUN }, new AjaxOptions { HttpMethod = "POST" })
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
